<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>后台用户管理</title>
</head>
<script>
var baseUrl = "<?php echo $this->baseUrl;?>";
</script>
<link href="<?php echo $this->baseUrl;?>/admincss/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl;?>/admincss/thickbox.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/jquery.pack.js" /></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/thickbox.compressed.js" /></script>
<script language="javascript" type="text/javascript" src="<?php echo $this->baseUrl;?>/adminjs/user.js" /></script>

<body>
<table class="tableA" width="100%" border="1">
  <tr>
    <td width="5%" nowrap="nowrap">ID</td>
    <td width="6%" nowrap="nowrap">用户名</td>
    <td width="13%" nowrap="nowrap">cash</td>
    <td width="13%" nowrap="nowrap">下注情况</td>
    <td width="13%" nowrap="nowrap">彩池</td>
    <td width="13%" nowrap="nowrap">系统开奖</td>
    <td width="13%" nowrap="nowrap">返回开奖</td>
    <td width="13%" nowrap="nowrap">奖励</td>
    <td width="12%" nowrap="nowrap">下注ip</td>
    <td width="4%" nowrap="nowrap">下注时间</td>
  </tr>
<?php
foreach ($this->list as $v){
$str_bet = "";
$str_pool = "";
$str_sys = "";

$arr_bet_names = array("袁绍", "孙权", "大乔", "夏侯惇", "曹操", "关羽", "张飞", "特殊");

$arr_names = array("袁绍","小关羽","小张飞","小大乔", "	小孙权", "小曹操","小夏侯","大夏侯",
	"大曹操","大孙权","大大乔","大张飞","大关羽","小特殊","大特殊");

for ($i=0; $i < 8; $i++){
	if ($v['bet_' . $i] > 0){
		$str_bet .= $arr_bet_names[$i] . ':' . $v['bet_' . $i] . '&nbsp;';
	}
}
$str_bet .= " total=" . $v['bet_total'];

if ($v['usemaxpool']){
	$str_pool = '大 ' . $v['pool_max'] . "->" . $v['pool_max_after'];
}else{
	$str_pool = '小 ' . $v['pool_min'] . "->" . $v['pool_min_after'];;
}

$str_sys = $arr_names[$v['open_rate']] .' ' .$v['open_rate_beilv']."倍 max" . $v['sys_max_beilv'] . '倍';
/**
  `user_win` int(8) NOT NULL, -- 用户赢的
  `user_real_win` int(8) NOT NULL,  -- 用户减去投注之后赢的	
 */
$str_ret = $arr_names[$v['ret_rate_bet']] . ' icon' . $v['ret_icon'];
if ($v['user_win'] > 0){
	$str_ret .= ' <font color="red">中奖</font>';
}
$str_award = $v['user_real_win'];

$ip = long2ip($v['ip']);
print <<<EOT
  <tr>
  <td nowrap="nowrap">{$v['id']}</td>
    <td width="6%" nowrap="nowrap">{$v['username']}</td>
    <td width="13%" nowrap="nowrap">{$v['cash']}</td>
    <td width="13%" nowrap="nowrap">{$str_bet}</td>
    <td width="13%" nowrap="nowrap">{$str_pool}</td>
    <td width="13%" nowrap="nowrap">{$str_sys}</td>
    <td width="13%" nowrap="nowrap">{$str_ret}</td>
    <td width="13%" nowrap="nowrap">{$str_award}</td>
    <td width="12%" nowrap="nowrap">{$ip}</td>
    <td width="4%" nowrap="nowrap">{$v['bettime']}</td>
  </tr>
EOT;
}
$indexurl =$this->url($this->fullUrl, 'user', 'log', 'nowp=1');
$nexturl = $this->url($this->fullUrl, 'user', 'log', 'nowp='.$this->page['next']);
$preurl = $this->url($this->fullUrl, 'user', 'log', 'nowp='.$this->page['previous']);
$lasturl = $this->url($this->fullUrl, 'user', 'log', 'nowp='.$this->page['totalpage']);
print <<<EOT
  <tr>
    <td colspan="11">共{$this->page['totalnum']}个用户 {$this->page['nowp']}/{$this->page ['totalpage']}
<a href="{$indexurl}">首页</a>
<a href="{$nexturl}">下一页</a>
<a href="{$preurl}">前一页</a>
<a href="{$lasturl}">末页</a></td>
  </tr>
EOT;
?>
</table>
</body>
</html>
